a2f82b40628a12cbba67119e2cd57c4e28cf8b28,drools-clips/src/main/java/org/drools/clp/CLPParser.java,CLPParser,defrule,#,468
Before Change
rule.addAttribute( module );
}
rule.setLocation( offset(loc.getLine()), loc.getCharPositionInLine() );
rule.setStartCharacter( ((CommonToken)loc).getStartIndex() );
// not sure how you define where a LHS starts in clips, so just putting it here for now
lhs = new AndDescr();
After Change
// C:\\dev\\jbossrules\\trunk07\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:288:4: loc= LEFT_PAREN DEFRULE ruleName= NAME documentation= STRING ruleAttribute[rule] ( ce[lhs] )* '=>' engine= execution_block RIGHT_PAREN
{
loc=(Token)input.LT(1);
match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_defrule235); if (failed) return rule;
match(input,DEFRULE,FOLLOW_DEFRULE_in_defrule243); if (failed) return rule;
ruleName=(Token)input.LT(1);
match(input,NAME,FOLLOW_NAME_in_defrule247); if (failed) return rule;
if ( backtracking==0 ) {
debug( "start rule: " + ruleName.getText() );
String ruleStr = ruleName.getText();
if ( ruleStr.indexOf("::") >= 0 ) {
String mod = ruleStr.substring(0, ruleStr.indexOf("::"));
ruleStr = ruleStr.substring(ruleStr.indexOf("::")+2);
module = new AttributeDescr( "agenda-group", mod );
module.setLocation( offset(ruleName.getLine()), ruleName.getCharPositionInLine() );
module.setStartCharacter( ((CommonToken)ruleName).getStartIndex() );
module.setEndCharacter( ((CommonToken)ruleName).getStopIndex() );
}
rule = new RuleDescr( ruleStr, null );
if( module != null ) {
rule.addAttribute( module );
}
rule.setLocation( offset(loc.getLine()), loc.getCharPositionInLine() );
rule.setStartCharacter( ((CommonToken)loc).getStartIndex() );
// not sure how you define where a LHS starts in clips, so just putting it here for now
lhs = new AndDescr();
rule.setLhs( lhs );
lhs.setLocation( offset(loc.getLine()), loc.getCharPositionInLine() );
lhs.setStartCharacter( ((CommonToken)loc).getStartIndex() );
rule.addAttribute( new AttributeDescr( "dialect", "clips") );
}
documentation=(Token)input.LT(1);
match(input,STRING,FOLLOW_STRING_in_defrule259); if (failed) return rule;
if ( backtracking==0 ) {
// do nothing here for now
}
pushFollow(FOLLOW_ruleAttribute_in_defrule265);
ruleAttribute(rule);
_fsp--;
if (failed) return rule;
// C:\\dev\\jbossrules\\trunk07\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:325:3: ( ce[lhs] )*
loop4:
do {
int alt4=2;
int LA4_0 = input.LA(1);
if ( (LA4_0==LEFT_PAREN||LA4_0==VAR) ) {
alt4=1;
}
switch (alt4) {
case 1 :
// C:\\dev\\jbossrules\\trunk07\\drools-clips\\src\\main\\resources\\org\\drools\\clp\\CLP.g:325:3: ce[lhs]
{
pushFollow(FOLLOW_ce_in_defrule273);
ce(lhs);
_fsp--;
if (failed) return rule;
}
break;
default :
break loop4;
}
} while (true);
match(input,43,FOLLOW_43_in_defrule282); if (failed) return rule;
pushFollow(FOLLOW_execution_block_in_defrule291);
engine=execution_block();
_fsp--;
if (failed) return rule;
if ( backtracking==0 ) {
rule.setConsequence( engine );
}
match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_defrule300); if (failed) return rule;
}